home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
zmenu_v2.zip
/
ZMNUCOLR.T
< prev
next >
Wrap
Text File
|
1990-04-22
|
5KB
|
148 lines
:: this script creates a temporary file to hold output from p command
:: the file is then scanned for the various color p numeric values.
:: these values are put into colr variables for decyphering.
:: Uses fa7 fs11 fs10
colors:
:: Save the current variable values in .bak
set s0 zmnucolr.bak;source zmnusave.t
sets fs11 %dircx;sets dircx %lib
:: variables used to communicate between zmenu.t and zmnucolr.t
:: fa7 switch to do colordisplay
set fa7 y;findq "fa7" zmnumain.bak;set ifs " `";if ? split z0;sets fa7 %z1
if ifa7,y cls type zmnubox.scr
if ifa7,y lput "\E[31;1m\E[23CMENU COLOR SELECTION GUIDE\n\r"
if ifa7,y lput "\E[0;37m\E[15CHere is analysis of current numeric color parameters"
if ifa7,y lput "\n\r\E[0;37m\E[15CNote: all background (bg) colors are low intensity,"
if ifa7,y lput "\n\r\E[0;37m\E[15Cand there is no brown, only 1 yellow. (ANSI mode)"
>nul
del zmnucolr.tmp
>zmnucolr.tmp
p
>
>nul
del zmnucolr.prm
>
>zmnucolr.prm
: normal value
findq " n =" zmnucolr.tmp
split z0 "n" "=" " " ""
sets s0 %z2
echof "pn%z2"
sets fs10 "Normal pn"
gosub colorcomp.%lib/zmnucolr.t
echof "colrn \E[%s1\&%s4\&%s2\&%s3"
: status line
findq "q =" zmnucolr.tmp
split z0 "s" "=" " " ""
sets s0 %z2
echof "ps%z2"
sets fs10 "Stats ps"
gosub colorcomp.%lib/zmnucolr.t
echof "colrs \E[%s1\&%s4\&%s2\&%s3"
::
: highlight value
findq "# =" zmnucolr.tmp
split z0 "*" "=" " " ""
:: s0 contains value of p parameter
sets s0 %z2
echof "p*%z2"
sets fs10 "Highlight p*"
gosub colorcomp.%lib/zmnucolr.t
echof "colr* \E[%s1\&%s4\&%s2\&%s3"
::
: blink value
findq "# =" zmnucolr.tmp
split z0 "@" "=" " " ""
sets s0 %z2
echof "p@%z2"
sets fs10 "Blink p@"
gosub colorcomp.%lib/zmnucolr.t
echof "colr@ \E[%s1\&%s4\&%s2\&%s3"
::
: reverse value
findq "\nq =" zmnucolr.tmp
split z0 "r" "=" " " ""
sets s0 %z2
echof "pr%z2"
sets fs10 "Reverse pr"
gosub colorcomp.%lib/zmnucolr.t
echof "colrr \E[%s1\&%s4\&%s2\&%s3"
: underline
findq " u =" zmnucolr.tmp
split z0 "u" "=" " " ""
sets s0 %z2
echof "pu%z2"
sets fs10 "Underline pu"
gosub colorcomp.%lib/zmnucolr.t
echof "colru \E[%s1\&%s4\&%s2\&%s3"
>
lput "\E[s\E[25;1H\E[K\E[u"
if ifa7,y lput "\E[2B\E[80D\E[5C\E[0;33;1m"
if ifa7,y lput "\E[34;1mNote: pxnnn may be hex: px0xnn like pr0x1e\E[0;35m"
if ifa7,y lput "\E[3B\E[80D\E[5C Colors: 0=Black 1=Blue 2=Green 3=Cyan 4=Red 5=Magenta 6=Yellow \E[3A"
if ifa7,y acceptl s1 "\E[1A\E[80D\E[5C\E[0;31;1mEnter 'q' to stop or a pxnnn command: "
if !ifa7,y set s1 q
if is1,q goto colorsx
if js1,q goto colorsx
del zmnucolr.tmp
>zmnucolr.tmp
echof " %s1"
echof " return"
>
source zmnucolr.tmp
goto colors
colorsx: sets dircx %fs11
p?0;findq "fs10 " zmnucolr.bak;if ? split z0 " " "";sets fs10 "%z1"
p?0;findq "fs11 " zmnucolr.bak;if ? split z0 " " "";sets fs11 "%z1"
p?0;findq "fa7 " zmnucolr.bak;if ? split z0 " " "";sets fa7 "%z1"
return
colorcomp:
: s1 has normal/blink 0/1 value
setn s1 s0/128
: s2 has background color 0-7
setn s9 s1*8
setn s2 s0/16-s9
setn s9 s0/16*16
setn s8 s0-s9
: s3 has normal/highlight 0/1 value
setn s3 s8/8
setn s9 s3*8
: s4 has foreground color 0-7
setn s4 s8-s9
set s6 backgrnd;set s7 foregrnd;set s8 blink;set s9 hilite
if ifa7,y lput "\n\r\E[5C\E[0;37m%fs10\&%s0\E[80D\E[23C%s8 = %s1, %s6 = %s2, %s9 = %s3, %s7 = %s4"
if Js1,1 set s1 "5;";goto colors1x
set s1 ""
colors1x:
if Js3,1 set s3 ";1m";goto colors3x
set s3 "m"
colors3x:
if Js2,0 set s2 "40";goto colors2x
if Js2,1 set s2 "44";goto colors2x
if Js2,2 set s2 "42";goto colors2x
if Js2,3 set s2 "46";goto colors2x
if Js2,4 set s2 "41";goto colors2x
if Js2,5 set s2 "45";goto colors2x
if Js2,6 set s2 "43";goto colors2x
if Js2,7 set s2 "47"
colors2x:
if Js4,0 set s4 "30;";goto colors4x
if Js4,1 set s4 "34;";goto colors4x
if Js4,2 set s4 "32;";goto colors4x
if Js4,3 set s4 "36;";goto colors4x
if Js4,4 set s4 "31;";goto colors4x
if Js4,5 set s4 "35;";goto colors4x
if Js4,6 set s4 "33;";goto colors4x
if Js4,7 set s4 "37;"
colors4x:
if ifa7,y lput "\n\r\E[22C\E[0m \E[%s1\&%s4\&%s2\&%s3\&This is sample text"
return
:# = 24 $ = 80 * = 12 - = 0 ? = 0 @ = 140
:B = 1 C = 0 E = 0 F = 8 H = 0 K = 1
:N = 1 O = 0 R = 1 S = 15 T = 1 V = 0
:X = 0 Z = 72 a = 12000 b = 0 c = 300 d = 1
:e = 0 f = 60 g = 10 h = 0 i = 120 j = 0
:k = -1 l = 1 m = -1 n = 14 o = 1 p = 70
:q = 70 r = 29 s = 2 t = 4 u = 112 v = -1
:w = 0 x = 0 y = 9600 z = 240 _ = 0